.thumb
.arch armv5te
.fpu softvfp
.eabi_attribute 23, 1
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 1
.eabi_attribute 30, 2
.eabi_attribute 18, 4

.global swiDecompressLZSSWram
.global sendipcmsg

.thumb_func
swiDecompressLZSSWram:
svc 0x11
bx lr

.thumb_func
sendipcmsg: @ Sends a Nintendo SDK IPC msg: in_r0 = channel in_r1 = data.
ldr r2, =0x04000184 @ IPCFIFOCNT
mov r3, #0x1f
and r0, r0, r3
lsl r1, #6
orr r0, r0, r1
ldrh r1, [r2]
mov r3, #0x40
lsl r3, r3, #8
tst r1, r3
beq sendipcmsg_noerror
mov r0, #0
mvn r0, r0 @ Return -1 if the FIFO error bit is set.
bx lr

sendipcmsg_noerror:
mov r3, #2
tst r1, r3
beq sendipcmsg_notfull
mov r0, #0
mvn r0, r0 @ Return -1 if the send FIFO is full.
bx lr

sendipcmsg_notfull:
str r0, [r2, #4] @ Send the message.
mov r0, #0
bx lr

